package com.appwoo.txtws.service;

import android.content.Context;
import android.util.Xml;
import com.appwoo.android.exception.NotFoundNetWorkException;
import com.appwoo.android.exception.TimeOutException;
import com.appwoo.android.util.PullIO;
import com.appwoo.txtws.bean.AutoSoftInfo;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;

public class SoftInfoServer
{
  private Context context;

  public SoftInfoServer(Context paramContext)
  {
    this.context = paramContext;
  }

  public AutoSoftInfo getSoftInfo(String paramString1, String paramString2)
  {
    AutoSoftInfo localAutoSoftInfo1 = new AutoSoftInfo();
    String str1 = "<MSG><HEAD><SNDR>" + paramString1 + "</SNDR> " + "<TYPE>RQSoftIntro</TYPE></HEAD>" + "<BODY>" + "<KeyID>" + paramString2 + "</KeyID></BODY></MSG>";
    MsgService localMsgService = new MsgService();
    try
    {
      String str2 = localMsgService.sendMessage(paramString1, str1, this.context);
      AutoSoftInfo localAutoSoftInfo2 = pullXmlInstall(this.context, str2);
      return localAutoSoftInfo2;
    }
    catch (XmlPullParserException localXmlPullParserException)
    {
      localXmlPullParserException.printStackTrace();
      return localAutoSoftInfo1;
    }
    catch (NotFoundNetWorkException localNotFoundNetWorkException)
    {
      localNotFoundNetWorkException.printStackTrace();
      return localAutoSoftInfo1;
    }
    catch (TimeOutException localTimeOutException)
    {
      return localAutoSoftInfo1;
    }
    catch (IOException localIOException)
    {
    }
    return localAutoSoftInfo1;
  }

  public AutoSoftInfo pullXmlInstall(Context paramContext, String paramString)
    throws IOException, XmlPullParserException
  {
    AutoSoftInfo localAutoSoftInfo = new AutoSoftInfo();
    ArrayList localArrayList = new ArrayList();
    Object localObject = Xml.newPullParser();
    int i;
    try
    {
      XmlPullParser localXmlPullParser = PullIO.getPullByString(paramString);
      localObject = localXmlPullParser;
      i = ((XmlPullParser)localObject).getEventType();
      if (i == 1)
      {
        localAutoSoftInfo.setPicList(localArrayList);
        return localAutoSoftInfo;
      }
    }
    catch (NullPointerException localNullPointerException)
    {
      while (true)
        localNullPointerException.printStackTrace();
      switch (i)
      {
      default:
      case 2:
      }
    }
    while (true)
    {
      i = ((XmlPullParser)localObject).next();
      break;
      if (((XmlPullParser)localObject).getName().equalsIgnoreCase("SoftIntro"))
      {
        localAutoSoftInfo.setSoftIntro(((XmlPullParser)localObject).nextText());
        ((XmlPullParser)localObject).nextTag();
      }
      if (((XmlPullParser)localObject).getName().equalsIgnoreCase("PicPath"))
        localArrayList.add(((XmlPullParser)localObject).nextText());
    }
  }
}

/* Location:           C:\Documents and Settings\Administrator\classes_dex2jar.jar
 * Qualified Name:     com.appwoo.txtws.service.SoftInfoServer
 * JD-Core Version:    0.6.2
 */